import React, { Component } from "react";
import Tabbar from './components/tabbar/Tabbar'
// import logo from './logo.svg';
// import './App.css';
import {HashRouter as Router , Route ,Switch ,Redirect} from 'react-router-dom'
import Home from './components/home/Home'
import Sort from './components/sort/Sort'
import Cart from './components/cart/Cart'
import My from './components/my/My'
import GoodDetail from './components/goodDetail/GoodDetail'

class App extends Component {
  render() {
    return (
      <Router>
        <Switch>
          <Route path='/home' exact render={(props)=><Tabbar {...props}><Home></Home></Tabbar>}></Route>
          <Route path='/sort' exact render={(props)=><Tabbar {...props}><Sort></Sort></Tabbar>}></Route>
          <Route path='/cart' exact render={(props)=><Tabbar {...props}><Cart></Cart></Tabbar>}></Route>
          <Route path='/my' exact render={(props)=><Tabbar {...props}><My></My></Tabbar>}></Route>
          <Route path='/goodDetail/:goods_id' exact render={(props)=><GoodDetail {...props}></GoodDetail>}></Route>
          <Redirect to="/home"></Redirect>
        </Switch>
      </Router>
    )
  }
}


export default App;

